|
|
||||||||
|
To eliminate work, instead of having to manually add in code for unit
smoke and setting up what to smoke when, we can use a .h include, which
has it's own ('pre-processored') code to work out the relevant function
for our script. This time we'll use Smokeunit.h, and as you can see, the
line begins with #. This symbol is used for almost all the pre-processor
code, such as to define or include other things, and to indicate the code
in the .h which works out what Scriptor needs to output. You can find
and edit the actual SmokeUnit.h file in the scriptor\includes directory.
Lastly we need the script to constantly check for any damage, and to emit smoke from the smokepieces depending on the level of damage. To do this we add a line to Create() function, start-script SmokeUnit();. As it says, this starts the function SmokeUnit(), which is from the Smokeunit.h include and will perform this looping check. Now if we build our TA unit and damage it, it will smoke like normal.
The other main damage animation is the death explosions. These are caused
when the unit is killed, and can differ depending on the severity of the
final blow. We can also decide what type of corpse to convert to, with
weak damage leaving a corpse model resembling the normal unit, and high
damage leaving a few smoking rocks, or simply disintegrate the whole thing,
leaving nothing but debris and smoke. The severity is passed to us from
the TA engine, and we return the corpse type to use. The specific values
it checks against: 25; 50; 99; and the corpsetype = x; lines are
usually not altered, only the type of explosion.
Now our TA unit will not just disappear when killed, but perform an animated death, with the specific explosions and corpse being dependant on the damage of the final hit. If this is the case, you can either continue to Lesson3, or read the next little snippet of info, explaining...
Congratulations and everything, but hey... let us make haste onwards
Lesson 3. |
||||||||
| © Proud like a god (and a little Storm) |